package com.sample.vos
{
	import flash.events.Event;
	
	import mx.messaging.ChannelSet;
	import mx.messaging.channels.AMFChannel;
	
	import org.ticlib.navigator.PresistentGlobals;
	
	public class Globals extends PresistentGlobals
	{
		private var _channelSet:ChannelSet;

		[Bindable("serviceUrlChange")]
		public function get channelSet():ChannelSet
		{
			if((serviceUrl) && (!_channelSet))
			{
				_channelSet = new ChannelSet();
				_channelSet.addChannel(new AMFChannel("my-amf", serviceUrl));
			}
			return _channelSet;
		}
		
		[Bindable("serviceUrlChange")]
		public function get serviceUrl():String
		{
			return sharedObject.data.serviceUrl;
		}
		
		public function set serviceUrl(val:String):void
		{
			sharedObject.data.serviceUrl = val;
			dispatchEvent(new Event("serviceUrlChange"));
		}
	}
}